import { Controller, Get, Post, Body, Patch, Param, Delete } from '@nestjs/common';
import { TrainingtaskService } from './trainingtask.service';
import { CreateTrainingtaskDto } from './dto/create-trainingtask.dto';
import { UpdateTrainingtaskDto } from './dto/update-trainingtask.dto';

@Controller('trainingtask')
export class TrainingtaskController {
  constructor(private readonly trainingtaskService: TrainingtaskService) {}

  @Post()
  create(@Body() createTrainingtaskDto: CreateTrainingtaskDto) {
    return this.trainingtaskService.create(createTrainingtaskDto);
  }

  @Get()
  findAll() {
    return this.trainingtaskService.findAll();
  }

  @Get(':id')
  findOne(@Param('id') id: string) {
    return this.trainingtaskService.findOne(+id);
  }

  @Patch(':id')
  update(@Param('id') id: string, @Body() updateTrainingtaskDto: UpdateTrainingtaskDto) {
    return this.trainingtaskService.update(+id, updateTrainingtaskDto);
  }

  @Delete(':id')
  remove(@Param('id') id: string) {
    return this.trainingtaskService.remove(+id);
  }
}
